package com.dc.dao;

import com.dc.entity.DepartmentEntity;
import com.dc.entity.MaterialMachineEntity;
import com.dc.entity.MaterialSolidEntity;
import com.dc.entity.ShipRepairEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface MaterialSolidDao extends JpaRepository<MaterialSolidEntity, Long>, JpaSpecificationExecutor<MaterialSolidEntity> {

    Page<MaterialSolidEntity> findByShipRepairEntity(ShipRepairEntity shipRepair, Pageable pageable);

    Page<MaterialSolidEntity> findByShipRepairEntityAndDepartment(ShipRepairEntity shipRepair, DepartmentEntity department, Pageable pageable);

    List<MaterialSolidEntity> findByShipRepairEntityAndDepartment(ShipRepairEntity shipRepair, DepartmentEntity department);
}
